import requests

# 设置请求头信息，伪装成浏览器进行访问
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'}

# 模拟浏览器发送请求
response = requests.get("http://www.pxc.jx.cn/", headers=headers)

# 设置编码方式
response.encoding = 'utf-8'

# 将获取到的页面保存到本地文件
with open("D:\\萍乡学院.html", "w", encoding="utf-8") as f:
    f.write(response.text)
